import App from './App'
import { createPinia } from 'pinia'
import uviewPlus from '@/uni_modules/uview-plus'
// 跳转页面

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
Vue.use(createPinia()) // 注册 Pinia
Vue.use(uviewPlus) // 注册 uview-plus
App.mpType = 'app'
const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
import globalMixin from '@/mixins/index.js';
export function createApp() {
  const app = createSSRApp(App)
  const pinia = createPinia()
  
  app.use(pinia)
  app.use(uviewPlus)
  app.mixin(globalMixin);
  
  return {
    app,
	pinia
  }
}
// #endif

// #ifdef MP-WEIXIN
if (typeof document === 'undefined') {
  global.document = {
    documentElement: { style: {} },
    createElement: () => ({ addEventListener: () => {} })
  }
}
// #endif